<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="mall/header::head-fragment('校园商铺-个人中心','personal')">
</head>
<link th:href="@{/mall/css/bootstrap-modal.css}" rel="stylesheet">
<body>
<header th:replace="mall/header::header-fragment"></header>
<!-- nav -->
<nav th:replace="mall/header::nav-fragment"></nav>

<!-- personal -->
<div id="personal">
    <div class="self-info center">

        <!-- sidebar -->
        <div th:replace="mall/personal-sidebar::sidebar-fragment"></div>

        <div class="intro fr">
            <div class="info_item ml40"><span>我的积分:</span><span
                    th:text="${points}"></span>
                <input type="hidden" id="point1" th:value="${points}">
                <button type="button" class="btn btn-primary" onclick="exchange()">积分兑换</button>
            </div>
        </div>
        <div class="clear"></div>
    </div>
    <div class="content">
        <!-- 模态框（Modal） -->
        <div class="modal fade" id="personalInfoModal" tabindex="-1" role="dialog"
             aria-labelledby="personalInfoModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="main center">

                        <!--<th:block th:unless="${#lists.isEmpty(pageResult.list)}">-->
                            <!--<th:block th:each="goods : ${pageResult.list}">-->
                        <div class="item_card_frame">
                            <div class="item_card"><a href="" target="_blank"><img height="160px" width="160px"
                                    src="http://localhost:8080/upload/20200516_00115670.png" alt="百合花"></a></div>
                            <div class="item_brand"><a href="" target="_blank"
                                                       text="百合花">百合花</a></div>
                            <div class="item_price" text="50">50积分</div>
                            <button type="button" class="btn btn-primary" onclick="changegoods(10915,50)">积分兑换</button>
                        </div>

                            <!--</th:block>-->
                        <!--</th:block>-->
                        <div class="clear"></div>
                    </div>

                    <div class="clear"></div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary" id="saveButton">确认</button>
                    </div>
                </div>
            </div>
        </div>
        <!-- /.modal -->
    </div>
</div>

<div th:replace="mall/footer::footer-fragment"></div>

<!-- jQuery -->
<script th:src="@{/admin/plugins/jquery/jquery.min.js}"></script>
<!-- Bootstrap 3 -->
<script th:src="@{/mall/js/bootstrap3.js}"></script>
<script th:src="@{/mall/js/search.js}" type="text/javascript"></script>
<script th:src="@{/admin/plugins/sweetalert/sweetalert.min.js}"></script>
<script type="text/javascript">
    function exchange(){
        $('#personalInfoModal').modal();
    }
    function changegoods(goodid,point) {
        //point商品积分
        //poi拥有积分
        console.log(point);
        var  poi= $("#point1").val();
        console.log(poi);
        if(point>poi){
            swal("积分不足,无法兑换", {
                icon: "error",
            });
        }else{
            $.ajax({
                url:
            })
        }


    }

</script>
</body>
</html>